# 导包
import unittest,app,time
import HTMLTestRunner_PY3
from script.test_emp_params import TestEmployee
from script.test_ihrm_login_params import TestIHRMLogin
# 创建测试套件
suite = unittest.TestSuite()
# 将测试用例添加到测试套件
suite.addTest(unittest.makeSuite(TestEmployee))
suite.addTest(unittest.makeSuite(TestIHRMLogin))
# 使用HTMLTestRunner_PY3运行测试套件，生成测试报告
report_name = app.BASE_DIR + f"/report/ihrm {time.strftime('%Y%m%d %H%M%S')}.html"
with open(report_name, mode='wb') as f:
    # 实例化runner
    runner = HTMLTestRunner_PY3.HTMLTestRunner(f)
    # 使用runner运行测试套件
    runner.run(suite)